<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', 'HotQuestionController@hotQuestions');



//问题详情
Route::get('/detail/{id}', 'QuestionController@questionDetail');
//答案详情
Route::get('/answer/{id}', 'AnswerController@answerPage');
//修改答案
Route::put('/answer/{id}', 'AnswerController@updateAnswer');
//所有话题页面
Route::get('/topics', 'TopicController@getAllTopics');
//搜索问题页面
Route::get('/search', 'QuestionController@searchQuestions');
//提交问题页面
Route::get('/question', 'QuestionController@addQuestionPage');
//话题详情
Route::get('/topic/{id}', 'QuestionController@singleTopicPage');
//最新问题页面
Route::get('/new_questions', 'QuestionController@latestQuestion');

//提交问题
Route::post('/question', 'QuestionController@createQuestion');

//我的关注页面
Route::get('/attention', 'AttentionController@getAllAttentions');

//回答页面
Route::get('/do_answer/{id}' , 'AnswerController@doAnswerPage');
//编辑回答页面
Route::get('/edit_answer/{id}' , 'AnswerController@editAnswerPage');
//提交回答
Route::post('/answer' , 'AnswerController@doAnswer');

//关注
Route::post('/attention/{id}' , 'AttentionController@doAttention');
//举报
Route::post('/report/{id}' , 'AnswerController@reportAnswer');
//赞
Route::post('/up/{id}' , 'AnswerController@upAnswer');
//踩
Route::post('/down/{id}' , 'AnswerController@downAnswer');




/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

Route::group(['middleware' => ['web']], function () {
    //
});
